package com.zhuang.chapter23;

import java.util.ArrayList;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Test {
	public static void main(String[] args) {
		ArrayList<Integer> list = new ArrayList<Integer>();
		list.add(1);
		list.add(2);
		list.add(3);
		list.add(4);
		list.add(5);

		list.stream().filter(e -> e.equals(2)).forEach(System.out::println);

		String s1 = new String("hello");
		String s2 = new String("hello");
		String s3 = new String("world");
		String s4 = s1;
		System.out.println(s1 == s2);
		System.out.println(s3 == s2);
		System.out.println(s1 == s4);

	}
}
